<template>
  <view class="container">
	  
	  <!-- 顶部标题 -->
	  <view class="status_bar">
	  	<!-- 这里是状态栏 -->
	  </view>
	  <view class="top-tabar">
	  	<view class="arrow" @click="returing"></view>
	  	<view class="title-tbar">
	  		导航
	  	</view>
	  	<!-- 添加一个空的占位元素保持平衡 -->
	  	<view class="placeholder"></view>
	  </view>
<view class="total-con">
    <!-- 成功图标 -->
    <view class="success-icon">
      <uni-icons type="checkmarkempty" size="80" color="#ffffff"></uni-icons>
    </view>
    
    <!-- 成功标题 -->
    <view class="success-title">预约成功</view>
    
    <!-- 预约编号 -->
    <view class="order-info">
      <view class="order-label">预约编号：</view>
      <view class="order-number">{{ orderNumber }}</view>
    </view>
    
    <!-- 提示信息 -->
    <view class="tip-text">
      我们已收到您的预约申请，客服人员将在24小时内与您联系确认详情。
    </view>
    
    <!-- 按钮组 -->
    <view class="button-group">
      <button class="btn primary" @click="goToHome">返回首页</button>
      <button class="btn secondary" @click="goToDetail">预约详情</button>
    </view>
  </view>
  </view>
</template>

<script setup>
import { ref} from 'vue'
import {
		onLoad
	} from '@dcloudio/uni-app'
// 预约编号
const orderNumber = ref('324252536363634')

// 返回首页
const goToHome = () => {
  uni.reLaunch({
    url: '/pages/index/index'
  })
}

// 跳转到预约详情
const goToDetail = () => {
  uni.navigateTo({
    url: `/pages/VehicleMaintenance/NearbyStores/appointDetail/appointDetail?orderNumber=${orderNumber.value}`
  })
}

// 页面加载
onLoad((options) => {
  console.log('预约成功页面加载', options)
  
  // 如果有传递订单编号，更新数据
  if (options.orderNumber) {
    orderNumber.value = options.orderNumber
  }
})
</script>

<style scoped>
.container {
 
  min-height: 100vh;
  /* padding: 60rpx 40rpx; */
  /* background: linear-gradient(135deg, #f5f7fa 0%, #e4efe9 100%); */
  background-color: white;
}
.status_bar {
		height: var(--status-bar-height);
		width: 100%;
	}

	.title-tbar {
		color: white;
		font-size: 36rpx;
		text-align: center;
		position: absolute;
		left: 50%;
		transform: translateX(-50%);
	}

	.top-tabar {
		display: flex;
		justify-content: space-between;
		align-items: flex-start;
		background-color: #3486fd;
		height: 320rpx;
		padding: 20rpx;
		position: relative;
	}

	.arrow {
		border-top: 2rpx solid white;
		border-right: 2rpx solid white;
		height: 17rpx;
		width: 17rpx;
		margin-top: 15rpx;
		transform: rotate(225deg);
		flex-shrink: 0;
		z-index: 10;

		/* 添加点击效果 */
		&:active {
			opacity: 0.7;
			transform: rotate(225deg) scale(0.95);
		}
	}

	.placeholder {
		/* width: 20rpx;
		height: 20rpx;
		visibility: hidden; */
	}
	
	
	.total-con {
		width: 660rpx;
		margin: 0 auto;
		padding: 40rpx 20rpx;
		background-color: white;
		border-radius: 30rpx;
		position: relative;
		margin-top: -250rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
		
		
	}
	
.success-icon {
  width: 160rpx;
  height: 160rpx;
  border-radius: 50%;
  background-color: #5090ff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 40rpx;
  animation: scaleIn 0.6s ease-out;
}

.success-title {
  font-size: 48rpx;
  font-weight: bold;
  color: black;
  margin-bottom: 60rpx;
  text-align: center;
  animation: fadeInUp 0.8s ease-out;
}

.order-info {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #fff;
  padding: 30rpx 40rpx;
  border-radius: 16rpx;
  margin-bottom: 40rpx;
  box-shadow: 0 8rpx 32rpx rgba(7, 193, 96, 0.1);
  animation: fadeInUp 1s ease-out;
}

.order-label {
  font-size: 28rpx;
  color: #666;
  font-weight: 500;
}

.order-number {
  font-size: 32rpx;
  color: #333;
  font-weight: bold;
  font-family: 'Courier New', monospace;
}

.tip-text {
  font-size: 28rpx;
  color: #666;
  text-align: center;
  line-height: 1.6;
  margin-bottom: 80rpx;
  padding: 0 20rpx;
  animation: fadeInUp 1.2s ease-out;
}

.button-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24rpx;
  animation: fadeInUp 1.4s ease-out;
}

.btn {
  height: 88rpx;
  border-radius: 44rpx;
  font-size: 32rpx;
  font-weight: 600;
  border: none;
  transition: all 0.3s ease;
}

.btn.primary {
  background: linear-gradient(135deg, #0055ff, #00aaff);
  color: #fff;
  box-shadow: 0 8rpx 24rpx rgba(7, 193, 96, 0.3);
}

.btn.primary:active {
  transform: translateY(2rpx);
  box-shadow: 0 4rpx 12rpx rgba(7, 193, 96, 0.4);
}

.btn.secondary {
  background-color: #a5a5a5;
  color: #ffffff;
  border: 2rpx solid #07C160;
}

.btn.secondary:active {
  background-color: #f0f9f4;
}

/* 动画效果 */
@keyframes scaleIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  70% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes fadeInUp {
  0% {
    transform: translateY(30rpx);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

/* 响应式设计 */
@media (max-width: 750rpx) {
  .container {
    padding: 40rpx 30rpx;
  }
  
  .success-icon {
    width: 140rpx;
    height: 140rpx;
    margin-bottom: 30rpx;
  }
  
  .success-title {
    font-size: 42rpx;
    margin-bottom: 50rpx;
  }
  
  .order-info {
    flex-direction: column;
    gap: 16rpx;
    text-align: center;
  }
  
  .order-number {
    font-size: 30rpx;
  }
}
</style>